 
<style>
form{border: 1px solid #ccc;padding: 5px;}
.form-horizontal .form-group{margin:0;}
</style>

<div class="tab-content">
  <div role="tabpanel" class="tab-pane active" id="OrderInfo">
      <div class="ui-portlet clearfix">
          <div class="ui-portlet-header">
              <span class="title">订单信息</span>
          </div>
      <div class="ui-portlet-content">
    <div class="clearfix">
        <label class="col-sm-2">订单编号：</label>
        <div class="col-sm-9 controls">
            <span> {{$orderinfo['Order']['id']}}</span>
        </div>
    </div>

      <div class="clearfix">
          <label class="col-sm-2">订单子商户：</label>
          <div class="col-sm-9 controls">
              {{$orderinfo['Order']['mch_id']}}
          </div>
      </div>
      <div class="clearfix">
        <label class="col-sm-2">订单状态：</label>
        <div class="col-sm-9 controls">
          {{if $orderinfo['Order']['status'] > 0 }}
                <strong style="color:green;">
            {{else}} <strong style="color:red;">
            {{/if}}
            {{$status[$orderinfo['Order']['status']]}}</strong>
           
            <small>状态码：{{$orderinfo['Order']['status']}}</small>
        </div>
    </div>
    <div class="clearfix">
        <label class="col-sm-2">订单金额：</label>
        <div class="col-sm-9 controls">
           <span style="color:red"> {{$orderinfo['Order']['total_price']}}</span>
        </div>
    </div>
      </div></div>
       
   <?PHP  $user_id = $orderinfo['Order']['creator']; ?>
   <div class="alert alert-warning">
      <p>退款金额需小于该支付方式支付的金额。</p>
      <p>退款如果牵涉到用户权限或到期操作，请手动修改用户权限。如有其它相关事宜，请一并处理。</p>
   </div>
<form data-noajax="true" method="post" style="padding: 20px;margin: 20px 0;">
      <p class="form-inline">退款金额 <input type="text" class="form-control" name="data[Order][refund_fee]"></p>
      <p><input onclick="return confirm('是否确认发起退款');" type="submit" name="提交" class="btn btn-primary"></p>
</form>

 
  
    <portlet cache="no" list_tpl="inner" portlet="body"  model="RefundLog" limit="100" fields="RefundLog.*" order="id desc" info="conditions[order_id]=$order_id">
      {{if $key==0}}
    <div class="ui-portlet-header">
            <span class="title" style="color:orange;">订单已退款记录</span>
  </div>
   <table class="table table-bordered">
    <thead><tr><th>退款记录编号</th><th>支付方式</th><th>支付交易号</th><th>退款人编号</th><th>退款单号</th><th>退款时间</th><th>退款金额</th></tr></thead>
      {{/if}}
        <tr><td>{{$item['id']}}</td><td>{{$item['pay_method']}}</td><td>{{$item['transaction_id']}}</td><td>{{$item['staff_id']}}</td><td>{{$item['refund_no']}}</td><td>{{$item['created']}}</td><td><span class="product-price">{{$item['refund_fee']}}</span></td></tr>
      {{if $key==$count-1}}</table> {{/if}}
    </portlet>
   

   <div class="ui-portlet-header">
			      <span class="title">订单支付记录</span>
	</div>
   <table class="table table-bordered">
   	<thead><tr><th>支付记录编号</th><th>支付方式</th><th>银行</th><th>用户编号</th><th>币种</th><th>支付时间</th><th>支付金额</th><th>支付交易号</th></tr></thead>
   	<portlet cache="no" list_tpl="inner" portlet="body"  model="PayLog" limit="100" fields="PayLog.*" order="id desc" info="conditions[order_id]=$order_id">
        <tr><td>{{$item['id']}}</td><td>{{$item['pay_method']}}</td><td>{{$item['bank_type']}}</td><td>{{$item['user_id']}}</td><td>{{$item['fee_type']}}</td><td>{{$item['created']}}</td><td><span class="product-price">{{$item['total_fee']}}</span></td><td>{{$item['transaction_id']}}</td></tr>
   	</portlet>
   </table>

   <div class="ui-portlet-header">
            <span class="title">订单商品记录</span>            
  </div>
   <table class="table table-bordered">
    <thead><tr><th>商品编号</th><th>商品类型</th><th>商品名</th><th>加入购物车时间</th><th>价格</th><th>数量</th><th>合计</th><th>操作</th></tr></thead>
    <portlet cache="no" list_tpl="inner" portlet="body"  model="Cart" limit="100" fields="Cart.*" order="id desc" info="conditions[order_id]=$order_id&conditions[creator]=$user_id&conditions[status]=1">
      <tr><td>{{$item['product_id']}}</td><td>{{$item['product_model']}}</td><td>{{$item['name']}}</td><td>{{$item['created']}}</td><td><strong>{{$item['price']}}</strong></td><td><strong>{{$item['num']}}</strong></td><td>{{$item['price']*$item['num']}}</td><td><a href="/admin/{{Inflector::tableize($item['product_model'])}}/view/{{$item['product_id']}}" target="_blank">查看商品</a></td>
      </tr>
      <?PHP $total_price += $item['price']*$item['num']; ?>
    </portlet>
    <tr><td colspan="8"><P>未优惠前金额：<span style="color:red;">{{$total_price}}</span></P></td></tr>
   </table>
   
   <div class="ui-portlet-header">
	<span class="title">用户信息</span>            
</div>

   <table class="table table-bordered">
      	<thead><tr><th>用户编号</th><th>用户名称</th><th>用户手机</th><th>用户邮箱</th><th>注册时间</th><th>操作</th></tr></thead>   
   <portlet cache="no" list_tpl="inner" portlet="body"  model="User" limit="100" fields="*" order="id desc" info="recursive=-1&conditions[id]=$user_id">
	<tr><td>{{$item['id']}}</td><td>{{$item['username']}}</td><td>{{$item['mobile']}}</td><td>{{$item['email']}}</td><td>{{$item['created']}}</td><td><a href="/admin/users/view/{{$item['id']}}" target="_blank">查看</a></td></tr>
</portlet>
</table>
   
   
   </div>
   
</div>